package behavior.state;

/**
 * 暴击状态
 *
 * @author ykr
 * @date 2022/4/6
 */
public class CriticalState implements State {

	private Boss boss;

	public CriticalState(Boss boss) {
		this.boss = boss;
	}

	@Override
	public void attack(double atk, double crit) {
		double dmg = atk * crit - boss.getDef();
		boss.setLife(boss.getLife() - dmg);
		System.out.println("对" + boss.getName() + "造成了暴击，造成了" + dmg + "点伤害," + (boss.getLife() > 0 ? "boss剩余血量" + boss.getLife() : "boss已被击倒！"));
	}
}
